#!/bin/ash -efu
#
# mki-install
#
# This file is part of mkimage
# Copyright (C) 2007-2009  Alexey Gladkov <gladkov.alexey@gmail.com>
#
# This file is covered by the GNU General Public License,
# which should be included with mkimage as the file COPYING.
#

. "${0%/*}"/mki-sh-functions

verbose "has started executing."

case "$PROG" in
	*-image-*) dir="$subdir" ;;
esac

[ -d "$chroot" ] ||
	fatal "$dir: not look like a work directory of hasher."

hasher_args="$verbose $quiet ${HSH_EXCLUDE_DOCS:+--excludedocs} ${HSH_NUMBER:+--number="$HSH_NUMBER"}"

mki_list_pkgs "$@" |
	xargs -r env -i PATH="$PATH" hsh-install $hasher_args -- "$dir"
